public class ThreadDemo07 {
    public static void main(String[] args) {
        MyThread myThread = new MyThread();// 创建一个子线程
        myThread.start();// 开启子线程
        for (int i = 0; i < 1000; i++) {
            System.out.println("呵呵");
        }
    }
}

class MyThread extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("哈哈");
        }
    }
}
